import java.util.Scanner;

public class GuessNumber {
    public static void main(String[] args) {

            while (true){
                int answer=(int)(Math.random()*100);
                int guess=0;
                Scanner scanner =new Scanner(System.in);
                int times=0;
                while (times<7){
                    System.out.println("请猜一个1-100之间的数字");
                    guess=scanner.nextInt();
                    times=times+1;
                    if (guess<answer){
                        System.out.println("小了");
                    }else if (guess>answer){
                        System.out.println("大了");
                    }else {
                        System.out.println("对了");
                        break;
                    }
                }

                if (times==7 && answer!=guess){
                    System.out.println("可惜了");
                }
                System.out.println("再来一轮？ (y/n)");
                String choice =scanner.next();
                if (!choice.equalsIgnoreCase("y"));
                break;
            }

        }
    }

